#pragma once
#include "Main.h"

#include "ClientSocket.h"
#include "IResponse.h"
#include <boost/thread.hpp>
// Encapsulates processing the Request, sorting out what the Response should be, then calling the response.

class IRequest
{
public:
	IRequest(Client *aClient);
	IRequest();
	virtual ~IRequest(void);

	bool Call();
	bool operator()(void);
	bool IsStarted();
	bool IsRunning();
	// Must call Initialise;
	void Initialise();


	virtual bool ProcessHeader() = 0;
	virtual bool PrepareResponse() = 0;
	virtual bool DoResponse() = 0;
	virtual bool Output() = 0;
	virtual bool Die() = 0;

	Client *mClient;
	IResponse *mResponse;

private:
	bool Running;
	bool Started;
	boost::thread mWorkerThread;
	int TickStart;
};
